<include file="public@header"/>
<style type="text/css">
    .cardBox {
        width: 250px;
        box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
        text-align: center;
        float: left;
        margin-right: 10px;
        padding: 5px;
        padding-top: 15px;
    }

    .headerBox {
        color: #fff;
        padding: 10px;
        font-size: 15px;
        height: 50px;
    }

    .bodyBox {
        padding: 10px;
    }

    .bodyBox p {
        margin-left: 5px;
    }
</style>

</head>
<body>
<div class="wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a>甲供材</a></li>
        <li><a href="{:url('goods/add',array('id'=>$id))}">添加记录</a></li>
    </ul>


    <form class="well form-inline js-ajax-form margin-top-20" method="post" action="{:url('Search')}">
        是否代买:
        <select name="replace" class="form-control">
            <option value=""></option>
            <option value="1">是</option>
            <option value="2">否</option>
        </select>
        <input type="hidden" name="id" value="{$id}">

        <button type="submit" class="btn btn-primary ">搜索</button>
        <a class="btn btn-danger" href="">清空</a>

    </form>

    <div class="cardBox" style="margin-bottom: 60px">
        <div class="headerBox" style="background-color: #006fc4;">
            <p>
                代买总计 : {$count}
            </p>
        </div>
    </div>
    <form method="post" class="js-ajax-form margin-top-20">
        <table class="table table-hover table-bordered">
            <thead>
            <tr>
                <th>使用班组</th>
                <th>事件</th>
                <th>签收人</th>
                <th>仓库/现场</th>
                <th>班组接货</th>
                <th>是否签字</th>
                <th>是否代买</th>
                <th>代买数量</th>
                <th>代买单价</th>
                <th>代买总价</th>
                <th>{:lang('ACTIONS')}</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="res" item="v">
                <tr>
                    <td>{$v.leaderName}</td>
                    <td>{$v.desc}</td>

                    <td>{$v.sign}</td>
                    <td>
                        <?php
                        if($v['adress'] == 1){
                        ?>
                        仓库
                        <?php }else{?>
                        现场
                        <?php }?>
                    </td>
                    <td>{$v.classes}</td>
                    <td>
                        <?php
                        if($v['isSign'] == 1){
                        ?>
                       <span class="label label-success">是</span>
                        <?php }else{?>
                        <span class="label label-danger">否</span>
                        <?php }?>
                    </td>
                    <td>
                        <?php
                        if($v['replace'] == 1){
                        ?>
                        <span class="label label-success">是</span>
                        <?php }else{?>
                        <span class="label label-danger">否</span>
                        <?php }?>
                    </td>
                    <td>{$v.replceNums}</td>
                    <td>{$v.replcePrice}</td>
                    <td>
                        <?php
                            echo($v['replceNums'] * $v['replcePrice']);
                            ?>

                    </td>


                    <td>
                        <a class="btn btn-xs btn-primary js-ajax-submit"
                           href="{:url('goods/see',array('id'=>$v['id'],'eid'=>$id))}">查看</a>
                        <a class="btn btn-xs btn-danger js-ajax-delete" href="{:url('goods/del',array('id'=>$v['id']))}">{:lang('DELETE')}</a>
                    </td>
                </tr>
            </foreach>
            </tbody>
        </table>

    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
</body>
</html>